const { Sequelize } = require("sequelize");
const sequelize = new Sequelize("traffic_sql", "chnian", "123456", {
  host: "localhost",
  dialect: "mysql",
});

async function testConnection() {
  try {
    await sequelize.authenticate();
    console.log('数据库链接成功');
  } catch (error) {
    console.error('无法连接到数据库:', error);
  }
}

testConnection();

module.exports = sequelize;
